package com.yunxiangyue.CreateList

import androidx.room.Dao
import androidx.room.Insert
import androidx.room.Query
import androidx.room.Update


@Dao
interface MusicListDao {

    //插入用户新建的列表项
    @Insert
    abstract fun insertMusic(musicListItem: MusicListItem)


    //长按列表项弹出选择栏进行删除
    @Query("delete from MusicListItem where musicTitle = :musicTitle")
    fun deleteMusicList(musicTitle:String):Int

    @Update
    fun updateMusicList(musicListItem: MusicListItem):Int

    @Query("select * from MusicListItem where phone=:phone")
    fun queryAllByPhone(phone:String):MutableList<MusicListItem>



    @Query("select * from MusicListItem where musicTitle = :musicTitle")
    fun queryAllByTitle(musicTitle: String):MutableList<MusicListItem>

    @Query("delete from MusicListItem")
    fun deleteAll()


}